Skip to main content
PATCH
/
public
/
v1
/
toppie
/
campaigns
/
{campaign-id}
[BETA] Update Toppie Campaign
curl --request PATCH \
  --url https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "budget": 10000000000,
  "targets": {
    "add": [
      "<string>"
    ],
    "remove": [
      "<string>"
    ]
  },
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "targetRoas": 123,
  "isActive": true
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "adFormat": "banner",
  "chargeType": "CPM",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "budget": 123,
  "bidCount": 123,
  "budgetPeriod": "daily",
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "targetRoas": 10.25,
  "currencyCode": "USD",
  "isActive": true,
  "createdAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Path Parameters

campaign-id
string<uuid>
required

The ID of the campaign.

Body

application/json

Agency campaign fields to be updated

name
string | null

Campaign name, this will be propagated to campaigns in marketplaces

Required string length: 1 - 75
budget
integer | null

Total budget for this campaign, to be distributed across marketplaces

Required range: 0 < x < 20000000000
targets
object | null

Targets to be included or removed from the campaign

startDate
string<date-time> | null

Date when to start the campaign, specified in RFC 3339, if not set that campaign will start immediately after the campaign creation. Must include the Timezone definition.

endDate
string<date-time> | null

Date when to stop the campaign, specified in RFC 3339, if not set the campaign will never stop. This date must be greater than the start date and must be in the future. Must include the Timezone definition.

targetRoas
number | null

Target ROAS for the campaign

isActive
boolean | null

Flag to indicate if the campaign is active or not

Response

Successful Response

Represents a public version of an agency campaign, used in API responses.

id
string<uuid>
required

Internal identifier for the agency campaign

name
string
required

Campaign name

adFormat
enum<string>
required

The ad format for this campaign

Available options:
banner,
listing
chargeType
enum<string>
required

The charge type for this campaign

Available options:
CPM,
CPC,
CPA
accountId
string<uuid>
required

Account that owns this campaign

budget
integer
required

Total budget for this campaign

budgetPeriod
enum<string>
required

The periodicity of the budget

Available options:
daily,
weekly,
monthly,
total
startDate
string<date-time>
required

Date when the campaign starts, specified in RFC 3339. Must include the Timezone definition.

endDate
string<date-time>
required

Date when the campaign ends, specified in RFC 3339. Must include the Timezone definition.

targetRoas
number
required

Target ROAS for the campaign

Required range: 0.5 <= x <= 20
currencyCode
string
required

Currency code this campaign is working with in ISO 4217 format

Examples:

"USD"

isActive
boolean
required

Flag to indicate if the campaign is active or not

createdAt
string<date-time>
required

Date and time when the campaign was created

bidCount
integer | null

Bid count for the campaign (optional)